package com.qiang.demo01;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test03 {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        //添加000，002一直添加到999
        //删除含有5的元素
        for (int i = 0; i < 1000; i++) {
            String s = String.valueOf(i);
            c.add(s);
        }
        for (String s : c) {
            if (s.length() == 1 && (Integer.parseInt(s) != 5)) {
                System.out.println("00" + s);
            } else if (s.length() == 2 && (Integer.parseInt(s) / 10 != 5 && Integer.parseInt(s) % 10 != 5)) {
                System.out.println("0" + s);
            } else if (s.length() == 3 && (Integer.parseInt(s) / 100 != 5 && Integer.parseInt(s) / 10 % 10 != 5 && Integer.parseInt(s) % 10 != 5)) {
                System.out.println(s);
            }
        }
    }
}
